Added pod data to endpoint query to know out which Pods are related#411
Added pod data to endpoint query to know out which Pods are related#411willianbriotto wants to merge 2 commits intorunpod:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR expands the GraphQL endpoint listing query to include pod information, enabling callers to discover which pods back a given endpoint (and retrieve pod IDs/port data for direct proxy access patterns).
Changes:
- Added a
podsselection set to theQUERY_ENDPOINTGraphQL query. - Included pod attributes (
id,podType,ports,desiredStatus) in the endpoint response payload.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| pods { | ||
| id | ||
| podType | ||
| ports | ||
| desiredStatus | ||
| } |
There was a problem hiding this comment.
Adding pods to the default QUERY_ENDPOINT means every get_endpoints() call will now fetch per-endpoint pod lists (and their ports/status), which can significantly increase response size and latency for users with many endpoints/pods. Consider keeping QUERY_ENDPOINT as a lightweight list query and introducing a separate/opt-in query (or a second constant like QUERY_ENDPOINT_WITH_PODS) for callers that actually need pod details.
This commit adds pod data to the endpoint query to find out which pods are related to the endpoint. Today, only data from the created endpoint itself is returned, but it is not possible, for example, to know the pods' URL to make a request directly to it, since the URL has the format:
https://pod_id-port_number.proxy.runpod.net/
With this data, it will be possible after the endpoint is created to get more data from the pod by calling
get_pod(pod_id: str)